<?php

class spInputCheckbox extends spInput
{
	public function __construct( $data=null )
	{
		parent::__construct( $data );
		parent::addAttr( "type", "checkbox" );
	}
	
	public function setChecked( $bChecked )
	{
		if ( $bChecked )
			parent::addAttr( "checked", "checked" );
		else
			parent::removeAttr( "checked" );
	}
	
	public function setElementDataString( $s )
	{
		parent::setElementDataString( $s );	
		$this->setChecked( parent::getValue()=="on"?true:false );
	}
}

?>